package red.stu.pconstraint.dto.mapper.block;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import red.stu.pconstraint.dto.mapper.token.BlockExpression;

import java.util.List;

/**
 * 节点块
 * @author yihrmc @stu.red
 * @date 2019/11/15 9:16
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
public abstract class BaseNodeBlock {

    /**
     * 节点块类型
     */
    @NotNull
    private final String type;

    /**
     * 节点块描述信息
     */
    @Nullable
    private String text;

    /**
     * 节点块索引
     */
    @NotNull
    private Integer index;

    /**
     * 节点块拥有的所有操作
     */
    @Nullable
    private List<BlockExpression> expressions;

    public BaseNodeBlock(String type) {
        this.type = type;
    }

}
